﻿using System;
using System.Collections.Generic;
using ExpenseSystem.Common.BaseModel;

namespace ExpenseSystem.Model
{

    [TableName("SYS_USER")]
    public class UserModel:SystemModel
    {
        private string _code;
        private string _name;
        private string _password;
        private bool _isAdmin;
        private string _lastLogin;
        private bool _isSPCtl;

        public virtual string Code
        {
            get { return _code; }
            set
            {
                if (_code == value)
                    return;
                _code = value;
                if (!PropertyUpdated.Contains("Code"))
                    PropertyUpdated.Add("Code");
            }
        }
        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (_name == value)
                    return;
                _name = value;
                if (!PropertyUpdated.Contains("Name"))
                    PropertyUpdated.Add("Name");
            }
        }
        public virtual string Password
        {
            get { return _password; }
            set
            {
                if (_password == value)
                    return;
                _password = value;
                if (!PropertyUpdated.Contains("Password"))
                    PropertyUpdated.Add("Password");
            }
        }
        public virtual bool IsAdmin
        {
            get { return _isAdmin; }
            set
            {
                if (_isAdmin == value)
                    return;
                _isAdmin = value;
                if (!PropertyUpdated.Contains("IsAdmin"))
                    PropertyUpdated.Add("IsAdmin");
            }
        }
        public virtual string LastLogin
        {
            get { return _lastLogin; }
            set
            {
                if (_lastLogin == value)
                    return;
                _lastLogin = value;
                if (!PropertyUpdated.Contains("LastLogin"))
                    PropertyUpdated.Add("LastLogin");
            }
        }
        public virtual bool IsSpCtl
        {
            get { return _isSPCtl; }
            set
            {
                if (_isSPCtl == value)
                    return;
                _isSPCtl = value;
                if (!PropertyUpdated.Contains("IsSpCtl"))
                    PropertyUpdated.Add("IsSpCtl");
            }
        }
    }
}
